//
//  JProductPromiseView.m
//  HeadIndustry
//
//  Created by jun on 2017/8/29.
//  Copyright © 2017年 jun. All rights reserved.
//

#import "JProductPromiseView.h"

@implementation JProductPromiseView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        [self setUpView];
        
    }
    return self;
}

- (void)setUpView
{
    
    CALayer *img1 = [CALayer layer];
    img1.contents = (__bridge id _Nullable)([UIImage imageNamed:@"yes_iconyu"].CGImage);
    img1.top = 25/2.0 ;
    img1.left = 15 ;
    img1.size = CGSizeMake(15, 15);
    [self.layer addSublayer:img1];
    
    _titleLabel = [YYLabel new];
    _titleLabel.top = 0;
    _titleLabel.left = img1.right + 10;
    _titleLabel.size = CGSizeMake(80, 40);
    _titleLabel.font = kFONT_TITLE(14);
    _titleLabel.textColor = kRGBColor(78, 78, 78);
    _titleLabel.textAlignment = NSTextAlignmentLeft;
    _titleLabel.numberOfLines = 0;
    _titleLabel.text = @"正品保证";
    [self addSubview:_titleLabel];
    
    CALayer *img2 = [CALayer layer];
    img2.contents = (__bridge id _Nullable)([UIImage imageNamed:@"yes_iconyu"].CGImage);
    img2.top = 25/2.0;
    img2.left = _titleLabel.right + 5 ;
    img2.size = CGSizeMake(15,15);
    [self.layer addSublayer:img2];
    
    _promiseLabel = [YYLabel new];
    _promiseLabel.top = 0;
    _promiseLabel.left = img2.right +10;
    _promiseLabel.size = CGSizeMake(80, 40);
    _promiseLabel.font = kFONT_TITLE(14);
    _promiseLabel.textColor = kRGBColor(78, 78, 78);
    _promiseLabel.textAlignment = NSTextAlignmentLeft;
    _promiseLabel.text = @"7天退货";
    [self addSubview:_promiseLabel];
    
    CALayer *img3 = [CALayer layer];
    img3.contents = (__bridge id _Nullable)([UIImage imageNamed:@"yuanmore"].CGImage);
    img3.top = 35/2.0;
    img3.left = self.width - 20 -10 ;
    img3.size = CGSizeMake(20 , 5);
    [self.layer addSublayer:img3];
    
    
}

//- (void)setCommentModel:(JProductComment *)commentModel
//{
//    _commentModel = commentModel;
//    dispatch_async(dispatch_get_main_queue(), ^{
//        
//    });
//    
//}

@end
